<template>
  <div>
    <input type="text" v-model="user" />
    <button @click="login">登录</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      user: "",
      pwd: ""
    };
  },
  methods: {
    login() {
      const { user } = this;
      this.$axios({
        url: "/api/login",
        params: { user }
      }).then(
        ({ data }) => {
          console.log(data);
        },
        err => {
          console.log(err);
        }
      );
    }
  }
};
</script>

<style>
</style>